<?php
function Rename_Submenu($Rename_Submenu_ID, $Submenu_New_Caption, $Submenu_New_Order){
	$sql="
          UPDATE sub_category 
          SET 
            SC_Caption=\"$Submenu_New_Caption\", 
            SC_Order= $Submenu_New_Order
          WHERE ID=$Rename_Submenu_ID";
	//print $sql;
	@$sql_result = mysql_query($sql);
	return $sql_result;
}

function Delete_Submenu($Delete_Submenu_ID){
  	//test, ci podkategoria neobsahuje produkty
  	$sql="SELECT COUNT(*) FROM products WHERE SC_ID=$Delete_Submenu_ID";
	$sql_result_row = mysql_fetch_row(mysql_query($sql));
	if($sql_result_row[0]==0){
            //zistenie ID nadradenej kategorie
            $sql="SELECT TC_ID FROM sub_category WHERE ID=$Delete_Submenu_ID";
            $sql_result_row = mysql_fetch_row(mysql_query($sql));
            $TC_ID=$sql_result_row[0];
            //vymazanie
            $sql="DELETE FROM sub_category WHERE ID=$Delete_Submenu_ID";
            @$sql_result_delete = mysql_query($sql);
            if(!$sql_result_delete) print CC_ALERT2;
            //zistenie ci existuje v hlavnej kategorii este dalsie podmenu, ak nie, tak sa hlavne
            //menu zmeni na menu bez podmenu - pouzije sa ID top kategorie
            $sql="SELECT COUNT(*) FROM sub_category WHERE TC_ID=$TC_ID";
            $sql_result_row = mysql_fetch_row(mysql_query($sql));
            if($sql_result_row[0]==0){
                    Switch_TC_To_No_Have_SC($TC_ID);
                    Add_Submenu($TC_ID,"",0);
            }
            ///----------------------------------------------------------------------
            ///-------------------Funkcia modulu random_products---------------------
            //odstranenie hodnotenia neexistujuceho produktu
            if (file_exists("modules/random_products/random_products.inc")){									
                require_once("modules/random_products/random_products.inc");
                Delete_Category($Delete_Submenu_ID);
            }
            ///----------------------------------------------------------------------
            ///----------------------------------------------------------------------
		
	}
	else{
	  	print  "<script language=\"JavaScript\">
                <!--
                        window.alert(\"".CC_ALERT1." (".$sql_result_row[0].")\");
                //-->
                </script>";
        return 1;
	}
}

function Add_Submenu($TC_ID,$SC_Caption,$Submenu_Order){
	$sql_result = mysql_query("INSERT INTO sub_category (TC_ID,SC_Caption,SC_Order) VALUES($TC_ID,\"$SC_Caption\",$Submenu_Order)");
	return $sql_result;
}

function Switch_TC_To_Have_SC($TC_ID){
	@$sql_result = mysql_query("UPDATE top_category SET TC_Have_SC=1 WHERE ID=$TC_ID");
	return $sql_result;
}

function Switch_TC_To_No_Have_SC($TC_ID){
	@$sql_result = mysql_query("UPDATE top_category SET TC_Have_SC=0 WHERE ID=$TC_ID");
	return $sql_result;
}

function TC_Have_SC($TC_ID){
	$sql_result = mysql_fetch_row(mysql_query("SELECT TC_Have_SC FROM top_category WHERE ID=$TC_ID"));
	return $sql_result[0]; //1 or 0
}

function Insert_Submenu($TC_ID,$Submenu_Caption,$Submenu_Order){
  	//zistenie, ci ma menu podkategorie
	$sql_result_row = mysql_fetch_row(mysql_query("SELECT TC_Have_SC FROM top_category WHERE ID=$TC_ID"));
	if($sql_result_row[0]==0){//=menu nema podkategorie
            //premenovanie prazdneho zaznamu
            mysql_query("UPDATE sub_category SET SC_Caption=\"$Submenu_Caption\", SC_Order=$Submenu_Order WHERE TC_ID=$TC_ID");
            //nastavenie podkategorie na typ vlastniaci submenu
            Switch_TC_To_Have_SC($TC_ID);
	}
	else
            //pridanie zaznamu do databazy
            Add_Submenu($TC_ID,$Submenu_Caption,$Submenu_Order);
}

function Insert_Topmenu($Topmenu_Caption,$Topmenu_Order){
    @$sql_result = mysql_query("insert into top_category (TC_Caption, TC_HAVE_SC, TC_Order) VALUES(\"$Topmenu_Caption\",0,$Topmenu_Order)");
    return $sql_result && Add_Submenu(mysql_insert_id(),"",0);
}

function Rename_Topmenu($Rename_Topbmenu_ID, $Topmenu_New_Caption, $Topmenu_New_Order){
    @$sql_result = mysql_query("
      UPDATE top_category 
      SET 
        TC_Caption=\"$Topmenu_New_Caption\",
        TC_Order=$Topmenu_New_Order
      WHERE ID=$Rename_Topbmenu_ID");
    
    return $sql_result;
}

function GetSubmenuInfo($ID, &$Caption, &$OrderNo){
    if(!is_numeric($ID) and $ID<1) return 0;
    
    @$sql_result=mysql_query("SELECT SC_Caption, SC_Order FROM sub_category WHERE ID=".$ID);
    $sql_result_obj = mysql_fetch_object($sql_result);
            
    $Caption=$sql_result_obj->SC_Caption;
    $OrderNo=$sql_result_obj->SC_Order;
    
    return $sql_result;
}

function GetTopmenuInfo($ID, &$Caption, &$OrderNo){
    if(!is_numeric($ID) and $ID<1) return 0;
    
    @$sql_result=mysql_query("SELECT TC_Caption, TC_Order FROM top_category WHERE ID=".$ID);
    $sql_result_obj = mysql_fetch_object($sql_result);
            
    $Caption=$sql_result_obj->TC_Caption;
    $OrderNo=$sql_result_obj->TC_Order;
    
    return $sql_result;
}

function Delete_Topmenu($Delete_Topmenu_ID){
//overenie ci neobsahuje podkategorie
    do{
        if(TC_Have_SC($Delete_Topmenu_ID)){
                print  "<script language=\"JavaScript\">
                <!--
                        window.alert(\"".CC_ALERT3."\");
                //-->
                </script>";
        break;
        }
        //overenie ci neobsahuje produkty
        $sql_result = mysql_fetch_row(mysql_query("SELECT COUNT(*) FROM top_category,sub_category,products WHERE
                                                    ((top_category.ID=sub_category.TC_ID) and 
                                                    (sub_category.ID=products.SC_ID) and 
                                                    (top_category.ID=$Delete_Topmenu_ID))"));
        if($sql_result[0]){
            print  "<script language=\"JavaScript\">
                    <!--
                            window.alert(\"".CC_ALERT4." ($sql_result[0])\");
                    //-->
                    </script>";
            break;
        }
            @$sql_result = mysql_query("DELETE FROM top_category WHERE ID=$Delete_Topmenu_ID");
            return $sql_result;
    }while(0);
}

function New_Submenu_Form($ShowAsNewSubCategory,$ActualTCID,$roll_menu){
	if($ShowAsNewSubCategory==$ActualTCID)
            print "
                <table cellpadding=\"0\" cellspacing=\"0\" style=\"border: 0px;\">
                <tr>
                    <td>
                        <form action=\"categorie_creator.php\" method=\"post\">
                            <table cellpadding=\"0\" cellspacing=\"0\" style=\"border: 0px;\">
                            <tr>
                                <td>
                                    <input type=\"hidden\" value=\"NO\" name=\"ShowAsNewSubCategory\" />
                                    <input type=\"hidden\" value=\"".$roll_menu."\" name=\"roll_menu\" />
                                    <input type=\"hidden\" value=\"".$ActualTCID."\" name=\"TC_ID\" />
                                    <input type=\"text\" value=\"".CC_NAZOV."\" name=\"Submenu_Caption\" 
                                        style=\"width:150px;background-color:white;border:1px solid black;\" />
                                </td>
                                <td style=\"font-size:10px;font-family:verdana;\">                                                        
                                        ".CC_PORADOVE_CISLO.":
                                    </td>
                                    <td>
                                        <input type=\"text\" value=\"0\" name=\"Sub_Menu_Order\" 
                                            style=\"width:20px;background-color:white;border:1px solid black;\" 
                                        />
                                    </td>
                                <td>
                                    <input type=\"submit\" value=\"".CC_OK."\" style=\"width :50px;border:1px solid black;\"
                                        onmouseover=\"this.style.backgroundColor='".BUTTON_ON_OVER."'; this.style.fontWeight='bold';\"
                                        onmouseout= \"this.style.backgroundColor='".BUTTON_ON_OUT."'; this.style.fontWeight='normal';\" />
                                </td>
                            </tr>
                            </table>
                        </form>
                    </td>
                    <td>
                        <form action=\"categorie_creator.php\" method=\"post\">
                            <input type=\"hidden\" value=\"NO\" name=\"ShowAsNewSubCategory\" />
                            <input type=\"hidden\" value=\"".$roll_menu."\" name=\"roll_menu\" />
                            <input type=\"submit\" value=\"".CC_ZRUSIT."\" style=\"width :50px;border:1px solid black;\"
                                onmouseover=\"this.style.backgroundColor='".BUTTON_ON_OVER."'; this.style.fontWeight='bold';\"
                                onmouseout= \"this.style.backgroundColor='".BUTTON_ON_OUT."'; this.style.fontWeight='normal';\" />
                        </form>
                    </td>
                </tr>
                </table>";
	else
            print "
                <form action=\"categorie_creator.php\" method=\"post\">
                    <input type=\"hidden\" value=\"".$sql_array_SMnu->ID."\" name=\"ID\" />
                    <input type=\"hidden\" value=\"$ActualTCID\" name=\"ShowAsNewSubCategory\" />
                    <input type=\"hidden\" value=\"".$roll_menu."\" name=\"roll_menu\" />
                    <input type=\"submit\" value=\"".CC_PRIDAT_PODKATEGORIU."\" style=\"width :310px;border:1px solid black;\"
                        onmouseover=\"this.style.backgroundColor='".BUTTON_ON_OVER."'; this.style.fontWeight='bold';\"
                        onmouseout= \"this.style.backgroundColor='".BUTTON_ON_OUT."'; this.style.fontWeight='normal';\" />
                </form>";
}

function Rename_Submenu_Form($ShowAsUpdate,$ActualID,$roll_menu){
	if($ShowAsUpdate==$ActualID){
                $Caption='';
                $OrderNo='';
                GetSubmenuInfo($ActualID, $Caption, $OrderNo);
		print "
			<table cellpadding=\"0\" cellspacing=\"0\" style=\"border: 0px; font-family: verdana; font-size: 10px;\">
			<tr>
				<td>
					<form action=\"categorie_creator.php\" method=\"post\">
						<table cellpadding=\"0\" cellspacing=\"0\" style=\"border: 0px;width:100%;\">
						<tr style=\"border: 0px; font-family: verdana; font-size: 10px;\">
							<td>
                                                            <input type=\"hidden\" value=\"NO\" name=\"ShowAsUpdate\" />
                                                            <input type=\"hidden\" value=\"".$roll_menu."\" name=\"roll_menu\" />
                                                            <input type=\"hidden\" value=\"".$ActualID."\" name=\"Rename_Submenu_ID\" />
                                                            <input type=\"text\" value=\"".$Caption."\" name=\"Submenu_New_Caption\" 
                                                                style=\"width:115px;background-color:white;border:1px solid black;\" 
                                                            />
                                                        </td>
                                                        <td>                                                        
                                                            ".CC_PORADOVE_CISLO.":
                                                        </td>
                                                        <td>
                                                            <input type=\"text\" value=\"".$OrderNo."\" name=\"Submenu_New_Order\" 
                                                                style=\"width:20px;background-color:white;border:1px solid black;\" 
                                                            />
							</td>
							<td>
                                                            <input type=\"submit\" value=\"".CC_OK."\" style=\"width:50px;border:1px solid black;\"
                                                                onmouseover=\"this.style.backgroundColor='".BUTTON_ON_OVER."'; this.style.fontWeight='bold';\"
                                                                onmouseout= \"this.style.backgroundColor='".BUTTON_ON_OUT."'; this.style.fontWeight='normal';\" />
                                                        </td>
						</tr>
						</table>
					</form>
				<td>
					<form action=\"categorie_creator.php\" method=\"post\">
                                            <input type=\"hidden\" value=\"NO\" name=\"ShowAsUpdate\" />
                                            <input type=\"hidden\" value=\"".$roll_menu."\" name=\"roll_menu\" />
                                            <input type=\"submit\" value=\"".CC_ZRUSIT."\" style=\"width :50px;border:1px solid black;\"
                                                onmouseover=\"this.style.backgroundColor='".BUTTON_ON_OVER."'; this.style.fontWeight='bold';\"
                                                onmouseout= \"this.style.backgroundColor='".BUTTON_ON_OUT."'; this.style.fontWeight='normal';\" />
					</form>
				</td>
			</tr>
			</table>";		
        }
	else{
		print "
			<form action=\"categorie_creator.php\" method=\"post\">
                            <input type=\"hidden\" value=\"".$sql_array_SMnu->ID."\" name=\"ID\" />
                            <input type=\"hidden\" value=\"$ActualID\" name=\"ShowAsUpdate\" />
                            <input type=\"hidden\" value=\"".$roll_menu."\" name=\"roll_menu\" />
                            <input type=\"submit\" value=\"".CC_PREMENOVAT."\" style=\"width :310px;border:1px solid black;text-align:center;\"
		        	onmouseover=\"this.style.backgroundColor='".BUTTON_ON_OVER."'; this.style.fontWeight='bold';\"
		        	onmouseout= \"this.style.backgroundColor='".BUTTON_ON_OUT."'; this.style.fontWeight='normal';\" />
			</form>";
        }
}

function Delete_Submenu_Form($ShowAsDelete,$ActualID,$roll_menu){
	if($ShowAsDelete==$ActualID)
		print "
			<table cellpadding=\"0\" cellspacing=\"0\" style=\"border: 0px;\">
			<tr>
				<td>
					<form action=\"categorie_creator.php\" method=\"post\">
						<table cellpadding=\"0\" cellspacing=\"0\" style=\"border: 0px;\">
						<tr>
							<td>
								<font style=\"font-size:10px;font-family:verdana;\"><b>".CC_NAOZAJ_ODSTRANIT."</b></font><br />
							</td>
							<td>
								<input type=\"hidden\" value=\"NO\" name=\"ShowAsDelete\" />
							</td>
							<td>
								<input type=\"hidden\" value=\"".$roll_menu."\" name=\"roll_menu\" />
								<input type=\"hidden\" value=\"".$ActualID."\" name=\"Delete_Submenu_ID\" />
                                                                <input type=\"submit\" value=\"".CC_ANO."\" style=\"width :50px;border:1px solid black;\"
						        	onmouseover=\"this.style.backgroundColor='".BUTTON_ON_OVER."'; this.style.fontWeight='bold';\"
						        	onmouseout= \"this.style.backgroundColor='".BUTTON_ON_OUT."'; this.style.fontWeight='normal';\" />
						    </td>
						</tr>
						</table>
					</form>
				</td>
				<td>
					<form action=\"categorie_creator.php\" method=\"post\">
						<input type=\"hidden\" value=\"NO\" name=\"ShowAsDelete\" />
						<input type=\"hidden\" value=\"".$roll_menu."\" name=\"roll_menu\" />
				    	<input type=\"submit\" value=\"".CC_NIE."\" style=\"width :50px;border:1px solid black;\"
				        	onmouseover=\"this.style.backgroundColor='".BUTTON_ON_OVER."'; this.style.fontWeight='bold';\"
				        	onmouseout= \"this.style.backgroundColor='".BUTTON_ON_OUT."'; this.style.fontWeight='normal';\" />
					</form>
				</td>
			</tr>
		</table>";
	else
		print "
			<form action=\"categorie_creator.php\" method=\"post\">
				<input type=\"hidden\" value=\"".$sql_array_SMnu->ID."\" name=\"ID\" />
				<input type=\"hidden\" value=\"$ActualID\" name=\"ShowAsDelete\" />
				<input type=\"hidden\" value=\"".$roll_menu."\" name=\"roll_menu\" />
		    	<input type=\"submit\" value=\"".CC_ODSTRANIT."\" style=\"width :210px;border:1px solid black;text-align:center;\"
		        	onmouseover=\"this.style.backgroundColor='".BUTTON_ON_OVER."'; this.style.fontWeight='bold';\"
		        	onmouseout= \"this.style.backgroundColor='".BUTTON_ON_OUT."'; this.style.fontWeight='normal';\" />
			</form>";
}

function New_Topmenu_Form($ShowAsNewTopCategory,$roll_menu){
	if($ShowAsNewTopCategory=="YES"){
		print "
                    <table cellpadding=\"0\" cellspacing=\"0\" style=\"border: 0px;\">
                    <tr>
                        <td>
                            <form action=\"categorie_creator.php\" method=\"post\">
                                <table cellpadding=\"0\" cellspacing=\"0\" style=\"border: 0px;\">
                                <tr>
                                    <td>
                                            <input type=\"hidden\" value=\"NO\" name=\"ShowAsNewTopCategory\" />
                                            <input type=\"hidden\" value=\"".$roll_menu."\" name=\"roll_menu\" />
                                            <input type=\"text\" value=\"".CC_NAZOV."\" name=\"Top_Menu_Caption\" 
                                                    style=\"width:115px;background-color:white;border:1px solid black;\" />
                                    </td>
                                    <td style=\"font-size:10px;font-family:verdana;\">                                                        
                                        ".CC_PORADOVE_CISLO.":
                                    </td>
                                    <td>
                                        <input type=\"text\" value=\"0\" name=\"Top_Menu_Order\" 
                                            style=\"width:20px;background-color:white;border:1px solid black;\" 
                                        />
                                    </td>
                                    <td>
                                        <input type=\"submit\" value=\"".CC_OK."\" style=\"width :50px;border:1px solid black;\"
                                            onmouseover=\"this.style.backgroundColor='".BUTTON_ON_OVER."'; this.style.fontWeight='bold';\"
                                            onmouseout= \"this.style.backgroundColor='".BUTTON_ON_OUT."'; this.style.fontWeight='normal';\" />
                                    </td>
                                </tr>
                                </table>
                            </form>
                        </td>
                        <td>
                            <form action=\"categorie_creator.php\" method=\"post\">
                                <input type=\"hidden\" value=\"NO\" name=\"ShowAsNewTopCategory\" />
                                <input type=\"hidden\" value=\"".$roll_menu."\" name=\"roll_menu\" />
                                <input type=\"submit\" value=\"".CC_ZRUSIT."\" style=\"width :50px;border:1px solid black;\"
                                    onmouseover=\"this.style.backgroundColor='".BUTTON_ON_OVER."'; this.style.fontWeight='bold';\"
                                    onmouseout= \"this.style.backgroundColor='".BUTTON_ON_OUT."'; this.style.fontWeight='normal';\" />
                            </form>
                        </td>
                    </tr>
            </table>";		
        }
	else
            print "
                <form action=\"categorie_creator.php\" method=\"post\">
                    <input type=\"hidden\" value=\"".$sql_array_SMnu->ID."\" name=\"ID\" />
                    <input type=\"hidden\" value=\"YES\" name=\"ShowAsNewTopCategory\" />
                    <input type=\"hidden\" value=\"".$roll_menu."\" name=\"roll_menu\" />
                    <input type=\"submit\" value=\"".CC_PRIDAT_HLAVNU_KATEGORIU."\" style=\"width :310px;border:1px solid black;\"
                        onmouseover=\"this.style.backgroundColor='".BUTTON_ON_OVER."'; this.style.fontWeight='bold';\"
                        onmouseout= \"this.style.backgroundColor='".BUTTON_ON_OUT."'; this.style.fontWeight='normal';\" />
                </form>";
}

function Rename_Topmenu_Form($ShowAsTopMenuUpdate,$ActualID,$roll_menu){
	if($ShowAsTopMenuUpdate==$ActualID){
                $Caption='';
                $OrderNo='';
                GetTopmenuInfo($ActualID, $Caption, $OrderNo);
		print "
			<table cellpadding=\"0\" cellspacing=\"0\" style=\"border: 0px;\">
			<tr>
                            <td>
                                <form action=\"categorie_creator.php\" method=\"post\">
                                    <table cellpadding=\"0\" cellspacing=\"0\" style=\"border: 0px;\">
                                        <tr style=\"border: 0px; font-size:10px; font-family:verdana;\">
                                            <td>
                                                <input type=\"hidden\" value=\"NO\" name=\"ShowAsTopMenuUpdate\" />
                                                <input type=\"hidden\" value=\"".$roll_menu."\" name=\"roll_menu\" />
                                                <input type=\"hidden\" value=\"".$ActualID."\" name=\"Rename_Topbmenu_ID\" />
                                                <input type=\"text\" value=\"".$Caption."\" name=\"Topmenu_New_Caption\" 
                                                    style=\"width:115px;background-color:white;border:1px solid black;\" />
                                            </td>
                                            <td>                                                        
                                                ".CC_PORADOVE_CISLO.":
                                            </td>
                                            <td>
                                                <input type=\"text\" value=\"".$OrderNo."\" name=\"Topmenu_New_Order\" 
                                                    style=\"width:20px;background-color:white;border:1px solid black;\" 
                                                />
                                            </td>
                                            <td>
                                              <input type=\"submit\" value=\"".CC_OK."\" style=\"width :50px;border:1px solid black;\"
                                                    onmouseover=\"this.style.backgroundColor='".BUTTON_ON_OVER."'; this.style.fontWeight='bold';\"
                                                    onmouseout= \"this.style.backgroundColor='".BUTTON_ON_OUT."'; this.style.fontWeight='normal';\" />
                                            </td>
                                        </tr>
                                    </table>
                                </form>
                            </td>
                            <td>
                                <form action=\"categorie_creator.php\" method=\"post\">
                                    <input type=\"hidden\" value=\"NO\" name=\"ShowAsTopMenuUpdate\" />
                                    <input type=\"hidden\" value=\"".$roll_menu."\" name=\"roll_menu\" />
                                    <input type=\"submit\" value=\"".CC_ZRUSIT."\" style=\"width :50px;border:1px solid black;\"
                                        onmouseover=\"this.style.backgroundColor='".BUTTON_ON_OVER."'; this.style.fontWeight='bold';\"
                                        onmouseout= \"this.style.backgroundColor='".BUTTON_ON_OUT."'; this.style.fontWeight='normal';\" />
                                </form>
                            </td>
			</tr>
			</table>";	
        }
	else
		print "
			<form action=\"categorie_creator.php\" method=\"post\">
				<input type=\"hidden\" value=\"".$sql_array_TMnu->ID."\" name=\"ID\" />
				<input type=\"hidden\" value=\"$ActualID\" name=\"ShowAsTopMenuUpdate\" />
				<input type=\"hidden\" value=\"".$roll_menu."\" name=\"roll_menu\" />
                                <input type=\"submit\" value=\"".CC_PREMENOVAT."\" style=\"width :310px;border:1px solid black;text-align:center;\"
                                    onmouseover=\"this.style.backgroundColor='".BUTTON_ON_OVER."'; this.style.fontWeight='bold';\"
                                    onmouseout= \"this.style.backgroundColor='".BUTTON_ON_OUT."'; this.style.fontWeight='normal';\" />
			</form>";
}

function Delete_Topmenu_Form($ShowAsTopMenuDelete,$ActualID,$roll_menu){
	if($ShowAsTopMenuDelete==$ActualID)
		print "
			<table cellpadding=\"0\" cellspacing=\"0\" style=\"border: 0px;\">
			<tr>
				<td>
					<form action=\"categorie_creator.php\" method=\"post\">
						<table cellpadding=\"0\" cellspacing=\"0\" style=\"border: 0px;\">
							<tr>
								<td>
									<font style=\"font-size:10px;font-family:verdana;\"><b>".CC_NAOZAJ_ODSTRANIT."</b></font><br />
								</td>
								<td>
									<input type=\"hidden\" value=\"NO\" name=\"ShowAsTopMenuDelete\" />
								</td>
								<td>
									<input type=\"hidden\" value=\"".$roll_menu."\" name=\"roll_menu\" />
									<input type=\"hidden\" value=\"".$ActualID."\" name=\"Delete_Topmenu_ID\" />
							    	<input type=\"submit\" value=\"".CC_ANO."\" style=\"width :50px;border:1px solid black;\"
							        	onmouseover=\"this.style.backgroundColor='".BUTTON_ON_OVER."'; this.style.fontWeight='bold';\"
							        	onmouseout= \"this.style.backgroundColor='".BUTTON_ON_OUT."'; this.style.fontWeight='normal';\" />
							    </td>
							</tr>
						</table>
					</form>
				</td>
				<td>
					<form action=\"categorie_creator.php\" method=\"post\">
						<input type=\"hidden\" value=\"NO\" name=\"ShowAsTopMenuDelete\" />
						<input type=\"hidden\" value=\"".$roll_menu."\" name=\"roll_menu\" />
				    	<input type=\"submit\" value=\"".CC_NIE."\" style=\"width :50px;border:1px solid black;\"
				        	onmouseover=\"this.style.backgroundColor='".BUTTON_ON_OVER."'; this.style.fontWeight='bold';\"
				        	onmouseout= \"this.style.backgroundColor='".BUTTON_ON_OUT."'; this.style.fontWeight='normal';\" />
					</form>
				</td>
			</tr>
		</table>";		
	else
		print "
			<form action=\"categorie_creator.php\" method=\"post\">
				<input type=\"hidden\" value=\"".$sql_array_TMnu->ID."\" name=\"ID\" />
				<input type=\"hidden\" value=\"$ActualID\" name=\"ShowAsTopMenuDelete\" />
				<input type=\"hidden\" value=\"".$roll_menu."\" name=\"roll_menu\" />
		    	<input type=\"submit\" value=\"".CC_ODSTRANIT."\" style=\"width :210px;border:1px solid black;text-align:center;\"
		        	onmouseover=\"this.style.backgroundColor='".BUTTON_ON_OVER."'; this.style.fontWeight='bold';\"
		        	onmouseout= \"this.style.backgroundColor='".BUTTON_ON_OUT."'; this.style.fontWeight='normal';\" />
			</form>";
}
?>